package com.example.service;

import com.baomidou.mybatisplus.extension.api.R;
import com.example.pojo.Admin;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.pojo.RespBean;
import com.example.pojo.Role;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author hx
 * @since 2021-10-08
 */
public interface IAdminService extends IService<Admin> {

    /**
     * @param username
     * @param password
     * @param request
     * @Description: 登录之后返回的token
     * @Author: Hx
     * @Date: 2021/10/8
    */
    RespBean login(String username, String password, String code,HttpServletRequest request);

    Admin getAdminByUsername(String username);

    List<Role> getRoles(Integer adminId);

    List<Admin> getAllAdmins(String keywords);


    RespBean addAdminRole(Integer adminId, Integer[] rids);

    /**
     * 更新用户密码
     * @param oldPass
     * @param pass
     * @param adminId
     * @return
     */
    RespBean updateAdminPass(String oldPass, String pass, Integer adminId);
}
